<?php

declare(strict_types=1);

namespace App\Controller\Am;
/**
 * 微信用户管理控制层
 * @Author abell
 * @DateTime 2020-06-08
 */

use App\Controller\AbstractController;
use App\Constants\ErrorCode;
// 注解路由
use App\Utils\ApiUtils;
use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\RequestMapping;
//业务层
use App\Service\WxuserService;
use Hyperf\Di\Annotation\Inject;
// 视图
use Hyperf\View\RenderInterface;

class WxuserController extends AbstractController
{
    /**
     * @Inject
     * @var WxuserService
     */
    protected $service;

    /**
     * 支付宝小程序用户
     * @Author abell
     * @DateTime 2020-05-26
     * @param array $request
     * @return
     */
    public function hello(RenderInterface $render){
        return $render->render('admin/index',['name'=>'后台首页']);
    }

    /**
     * 小程序用户编辑信息查看
     * @Author abell
     * @DateTime 2020-05-26
     * @param array $request
     * @return object
     */
    public function userList(){
        $count  = $this->service->userList();
        return $this->response->json(ApiUtils::send(0,'ok',$count,1));
    }
}
